#ifndef SINGLETON_H
#define SINGLETON_H

template
< typename T >
class singleton
{
    static T* c_instance;
public:
    static T* GetInstance();
};

template
< typename T >
T* singleton<T>::c_instance = nullptr;

template
< typename T >
T* singleton<T>::GetInstance()
{
    if ( c_instance == nullptr )
    {
        c_instance = new T();
    }
    
    return c_instance;
}

#endif // SINGLETON_H
